package com.casel.yusuke;

import com.example.yusukesshutdown.R;

import junit.framework.Test;
import junit.framework.TestSuite;
import android.R.anim;
import android.os.Bundle;
import android.app.Activity;
import android.app.ListActivity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.ListView;


public class MenuActivity extends ListActivity {
	private String[] tests={"Game","Help","Preferences","About"};
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		 this.getWindow().setFlags(
				 
				 WindowManager.LayoutParams.FLAG_FULLSCREEN,
				  WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,tests));
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.menu, menu);
		return true;
	}

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		String testName = tests[position];
	
		try{
			Class clase= Class.forName("com.casel.yusuke."+ testName+"Activity");
			Intent intent = new Intent(this, clase);
			startActivity(intent);
		}catch(ClassNotFoundException e){
			e.printStackTrace();
		}
		}
	
	}



